// stdexcept standard header
#pragma once
#ifndef _STDEXCEPT_
#define _STDEXCEPT_
#ifndef RC_INVOKED
#include <exception>
#include <xstring>

#ifdef _MSC_VER
 #pragma pack(push,_CRT_PACKING)
 #pragma warning(push,3)
#endif  /* _MSC_VER */
_STD_BEGIN

#ifndef _Mbstinit
 #define _Mbstinit(x)	_Mbstatet x = {0}
#endif /* _Mbstinit */

		// CLASS logic_error
class logic_error
	: public _XSTD exception
	{	// base of all logic-error exceptions
public:
	explicit __CLR_OR_THIS_CALL logic_error(const string& _Message)
		: _Str(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~logic_error() _THROW0()
		{	// destroy the object
		}

	virtual const char *__CLR_OR_THIS_CALL what() const _THROW0()
		{	// return pointer to message string
		return (_Str.c_str());
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

private:
	string _Str;	// the stored message string
	};

		// CLASS domain_error
class domain_error
	: public logic_error
	{	// base of all domain-error exceptions
public:
	explicit __CLR_OR_THIS_CALL domain_error(const string& _Message)
		: logic_error(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~domain_error() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

		// CLASS invalid_argument
class invalid_argument
	: public logic_error
	{	// base of all invalid-argument exceptions
public:
	explicit __CLR_OR_THIS_CALL invalid_argument(const string& _Message)
		: logic_error(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~invalid_argument() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

		// CLASS length_error
class length_error
	: public logic_error
	{	// base of all length-error exceptions
public:
	explicit __CLR_OR_THIS_CALL length_error(const string& _Message)
		: logic_error(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~length_error() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

		// CLASS out_of_range
class out_of_range
	: public logic_error
	{	// base of all out-of-range exceptions
public:
	explicit __CLR_OR_THIS_CALL out_of_range(const string& _Message)
		: logic_error(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~out_of_range() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

		// CLASS runtime_error
class runtime_error
	: public _XSTD exception
	{	// base of all runtime-error exceptions
public:
	explicit __CLR_OR_THIS_CALL runtime_error(const string& _Message)
		: _Str(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~runtime_error() _THROW0()
		{	// destroy the object
		}

	virtual const char *__CLR_OR_THIS_CALL what() const _THROW0()
		{	// return pointer to message string
		return (_Str.c_str());
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

private:
	string _Str;	// the stored message string
	};

		// CLASS overflow_error
class overflow_error
	: public runtime_error
	{	// base of all overflow-error exceptions
public:
	explicit __CLR_OR_THIS_CALL overflow_error(const string& _Message)
		: runtime_error(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~overflow_error() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

		// CLASS underflow_error
class underflow_error
	: public runtime_error
	{	// base of all underflow-error exceptions
public:
	explicit __CLR_OR_THIS_CALL underflow_error(const string& _Message)
		: runtime_error(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~underflow_error() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

		// CLASS range_error
class range_error
	: public runtime_error
	{	// base of all range-error exceptions
public:
	explicit __CLR_OR_THIS_CALL range_error(const string& _Message)
		: runtime_error(_Message)
		{	// construct from message string
		}

	virtual __CLR_OR_THIS_CALL ~range_error() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void __CLR_OR_THIS_CALL _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */

	};

#ifdef _M_CEE_PURE

inline
void __clrcall _String_base::_Xlen()
    {	// report a length_error
    _THROW(length_error, "string too long");
    }

inline
void __clrcall _String_base::_Xran()
    {	// report an out_of_range error
    _THROW(out_of_range, "invalid string position");
    }

inline
void __clrcall _String_base::_Xinvarg()
    {	// report an out_of_range error
    _THROW(invalid_argument, "invalid string argument");
    }

#endif

_STD_END
#ifdef _MSC_VER
 #pragma warning(pop)
 #pragma pack(pop)
#endif  /* _MSC_VER */

#endif /* RC_INVOKED */
#endif /* _STDEXCEPT_ */

/*
 * Copyright (c) 1992-2007 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
 V5.03:0009 */
